package com.ls.controller.superadmin;

import com.ls.entity.ShopCategory;
import com.ls.entity.dto.Result;
import com.ls.service.solo.ShopCategoryService;
import org.simpleframework.core.annotation.Controller;
import org.simpleframework.inject.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @program: simpleframework
 * @description:
 * @author: lishuang
 * @create: 2021-11-22 10:31
 **/
@Controller
public class ShopCategoryOperationController {
    @Autowired
    private ShopCategoryService categoryService;
    Result<Boolean> addShopCategory(HttpServletRequest req, HttpServletResponse res){
        return  categoryService.addShopCategory(new ShopCategory());
    }


    Result<Boolean> removeShopCategory(HttpServletRequest req, HttpServletResponse res){
        return categoryService.removeShopCategory(1);
    }

    Result<Boolean> modifyShopCategory(HttpServletRequest req, HttpServletResponse res){
        return categoryService.modifyShopCategory(new ShopCategory());
    }


    Result<ShopCategory> queryShopCategoryById(HttpServletRequest req, HttpServletResponse res){
        return categoryService.queryShopCategoryById(1);
    }


    Result<List<ShopCategory>> queryShopCategory(HttpServletRequest req, HttpServletResponse res){
        return categoryService.queryShopCategory(null,1,100);
    }
}
